<template>
  <div class="subpage" v-if="cinema">
    <my-head :title="cinema.name" :back="true"></my-head>
  </div>
</template>

<script>
export default {
  name: "cinema-detail",
  data() {
    return {
      cinema: null,
      films: [],
      schedules: [],
    };
  },
  mounted() {
    // 获取影院详细
    this.$ajax
      .getMaiData(
        {
          cinemaId: this.$route.params.cinemaId,
        },
        {
          "X-Host": "mall.film-ticket.cinema.info",
        }
      )
      .then((res) => {
        this.cinema = res.data.cinema;
      });

    // 获取当前电影院拍片的电影
    this.$ajax
      .getMaiData(
        {
          cinemaId: this.$route.params.cinemaId,
        },
        {
          "X-Host": "mall.film-ticket.film.cinema-show-film",
        }
      )
      .then((res) => {
        this.films = res.data.films;
      });
    // 获取今天的拍片时间
    this.$ajax
      .getMaiData(
        {
          cinemaId: this.$route.params.cinemaId,

          filmId: this.$route.params.filmId,
          data: this.$route.params.time,
        },
        {
          "X-Host": "mall.film-ticket.schedule.list",
        }
      )
      .then((res) => {
        this.schedules = res.data.schedules;
      });
  },
};
</script>